Making Radio Support Scripts



This section is completely optional. It is intended for scripters who want to make their own scripts using the HS radio system.


In the template mission included in this download, there is a folder called "support". Inside of it are two templates that you can use to base your scripts off of, in addition to a number of premade support scripts that you might want to look at. It is fairly simple to make new scripts for the player to use over the radio. Remember that in the hs_init.sqs file, you configure both a display name and a script name for each option that will appear in the radio menu. The script is executed as soon as the player selects the action, and that script is what this section is about. There are really only three special considerations you must make in such a script:


hs_rto_dly

At the top of your support script you should set the variable hs_rto_dly to a number. This will be the number of seconds delay before the player will be able to select another radio option in his action menu, and it is used so that other options cannot be selected while radio chatter is still going on.


Limiting uses

Remember that you can optionally assign a condition in hs_init.sqs that will determine whether the support option is available or not. If this condition is false, the option will not be displayed. One simple condition is to check if a variable is above 0: {MY_VAR > 0}.

Another alternative is to always have the support option visible in the radio menu, but check within the support script to see if the player has any uses left or not. See the second support template for an example. This lets you display radio chatter informing the player that he is out of uses, instead of just making the option disappear.


The player might not be holding the radio

Whenever you have radio chatter in your script, you should first make sure that the player is still holding the radio. You can test this by using the function hs_hearRTO. This returns true if the player is holding the radio, and false otherwise. Also, be sure to use the special radiochat functions mentioned in Special Editing Considerations. Here is an example:

? call hs_hearRTO : [player, "I need backup!"] call hs_sidechat


Other than that, your script can proceed just like any other artillery/airstrike/reinforcement/etc script would. Again, see the two included templates and support scripts for examples.